<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改优惠券')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-coupons-edit" th:object="${coupons}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠券标题：</label>
                <div class="col-sm-8">
                    <input name="title" th:field="*{title}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠券的描述：</label>
                <div class="col-sm-8">
                    <input name="description" th:field="*{description}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">门槛：</label>
                <div class="col-sm-8">
                    <input name="doorSill" th:field="*{doorSill}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">操作值 满减金额/折扣1-99：</label>
                <div class="col-sm-8">
                    <input name="reduce" th:field="*{reduce}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最多优惠(针对打折类) 0-不限制：</label>
                <div class="col-sm-8">
                    <input name="upperLimit" th:field="*{upperLimit}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商品使用规则 json 格式：</label>
                <div class="col-sm-8">
                    <textarea name="goodsScope" class="form-control">[[*{goodsScope}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发放张数。总数量 -1 不限：</label>
                <div class="col-sm-8">
                    <input name="num" th:field="*{num}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠券总数：</label>
                <div class="col-sm-8">
                    <input name="countNum" th:field="*{countNum}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">方式 1-手动发放 2-自动发放 3-自主领取：</label>
                <div class="col-sm-8">
                    <input name="auto" th:field="*{auto}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">跳转地址：</label>
                <div class="col-sm-8">
                    <input name="jumpTo" th:field="*{jumpTo}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">每次领取数量/天：</label>
                <div class="col-sm-8">
                    <input name="pullOnce" th:field="*{pullOnce}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最多领取数量：</label>
                <div class="col-sm-8">
                    <input name="pullMax" th:field="*{pullMax}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开始时间 0 取end_time长度时间票：</label>
                <div class="col-sm-8">
                    <input name="startTime" th:field="*{startTime}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结束时间 开始时间为0时则为票的有效长：</label>
                <div class="col-sm-8">
                    <input name="endTime" th:field="*{endTime}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开始发放时间：</label>
                <div class="col-sm-8">
                    <input name="startSendTime" th:field="*{startSendTime}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结束发放时间, 如果为0,只需大于开始时间即通过：</label>
                <div class="col-sm-8">
                    <input name="endSendTime" th:field="*{endSendTime}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠券权重排序 从大到小：</label>
                <div class="col-sm-8">
                    <input name="weight" th:field="*{weight}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">领取方式 1-直接发放 2-用户手动领取：</label>
                <div class="col-sm-8">
                    <input name="receiveWay" th:field="*{receiveWay}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">发放条件：</label>
                <div class="col-sm-8">
                    <textarea name="sendScope" class="form-control">[[*{sendScope}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠券互斥类型：</label>
                <div class="col-sm-8">
                    <input name="mutex" th:field="*{mutex}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">互斥规则 json格式：</label>
                <div class="col-sm-8">
                    <textarea name="mutexScope" class="form-control">[[*{mutexScope}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">展示位置：</label>
                <div class="col-sm-8">
                    <input name="showPosition" th:field="*{showPosition}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">优惠券使用规则：</label>
                <div class="col-sm-8">
                    <textarea name="couponRule" class="form-control">[[*{couponRule}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "mall/coupons";
        $("#form-coupons-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-coupons-edit').serialize());
            }
        }
    </script>
</body>
</html>